package com.shallowUniverse.process.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.shallowUniverse.process.entity.ProcessDefinition;
import com.shallowUniverse.process.mapper.provider.ProcessDefinitionProvider;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author gs
 * @date create in 2020/12/11 17:03
 */
@Repository
public interface ProcessDefinitionMapper {

    @SelectProvider(type = ProcessDefinitionProvider.class, method = "selectById")
    ProcessDefinition selecyById(Long id);

    @InsertProvider(type = ProcessDefinitionProvider.class, method = "insert")
    @Options(keyColumn = "id",keyProperty = "id",useGeneratedKeys = true)
    int insert(ProcessDefinition processDefinition);

    @DeleteProvider(type = ProcessDefinitionProvider.class,method = "deleteLogic")
    int deleteLogic(String id);

    @DeleteProvider(type = ProcessDefinitionProvider.class,method = "delete")
    int delete(String id);

    @SelectProvider(type = ProcessDefinitionProvider.class, method = "selectList")
    List<ProcessDefinition> selectList(ProcessDefinition processDefinition);

    @SelectProvider(type = ProcessDefinitionProvider.class, method = "selectList")
    IPage<ProcessDefinition> selectPage(IPage<ProcessDefinition> page, ProcessDefinition processDefinition);
}
